package com.by.service.impl;

import com.by.bean.Product;
import com.by.mapper.ProductMapper;
import com.by.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional//开启事务管理
@Service//声明为Service类
public class ProductServiceImpl implements ProductService {
    @Autowired
    ProductMapper productMapper;

    public List<Product> queryAll() {
        List<Product> list=productMapper.queryAll();
        return list;
    }

    @Override
    public int save(List<Product> list) {
        return productMapper.save(list);
    }
}
